package com.kgis.map.geometry {
    import com.kgis.map.Map;
    import com.kgis.map.common.enum.GeoTypeEnum;
    import com.kgis.map.geometry.basetype.Extent;
    import com.kgis.map.style.IStyle;
    import flash.display.Sprite;
    import com.kgis.map.geometry.AbstractGeometry;
    import com.kgis.map.geometry.IAreaGeometry;
    import com.kgis.map.geometry.PointGeometry;

    [Bindable]
    [RemoteClass(alias="com.kgis.map.model.geometry.CircleGeometry")]
    /**
     * 圆几何体
     */
    public class CircleGeometry extends AbstractGeometry implements IAreaGeometry {
        /**中心点坐标*/
        public var centerPoint:PointGeometry;

        /**半径*/
        public var radius:Number;

        public function CircleGeometry() {
            super();
        }

        /**
         * 绘制几何体
         */
        override public function draw(sprite:Sprite, geoStyle:IStyle, map:Map):void {
            return;
        }

        override public function getExtent():Extent {
            return null;
        }

        override public function getGeometryType():int {
            return GeoTypeEnum.CIRCLEGEOMETRY;
        }



        /**
         * 得到几何体范围
         */
        public function calculateBounds():void {
        /*		    if(this.geoExtent == null)
           {
           geoExtent = new Bounds(0,0,0,0);
           geoExtent.right = -999999999;
           geoExtent.left = 999999999;
           geoExtent.top = -999999999;
           geoExtent.bottom = 999999999;

           if(geoExtent.right < (centerPoint.x+radius))
           {
           geoExtent.right = centerPoint.x+radius;
           }
           if(geoExtent.left > (centerPoint.x-radius))
           {
           geoExtent.left = this.centerPoint.x-this.radius;
           }
           if(geoExtent.top <(this.centerPoint.y+this.radius))
           {
           geoExtent.top = this.centerPoint.y+this.radius;
           }
           if(geoExtent.bottom > (this.centerPoint.y-this.radius))
           {
           geoExtent.bottom = this.centerPoint.y-this.radius;
           }
           }
         return geoExtent;*/
        }
    }
}